Setting Up a Static IP Address
Your
router’s DHCP server offers each client a lease on the IP address, and
in most cases, that lease expires after 24 hours. When the expiration
time approaches, the client asks for a new IP address. In small
networks, the DHCP server often assigns each client the same IP address
each time, but that’s not guaranteed. Because when you’re working with
Windows 7 you rarely need to know a connection’s IP address, however, a
changing IP address is no big deal the vast majority of the time.
Tip
Instead of assigning a
static IP address to the Windows 7 computer, you might be able to get
your router to handle this for you. Log on to your router’s
configuration pages and look for an option that enables you to map a
static IP address to the computer MAC (see “Finding a Connection’s MAC Address,”
later in this chapter) address. This means that whenever the computer
requests a new DHCP lease, the router supplies the computer the same IP
address each time. Note that not all routers offer this option.
Note
The instructions in this section work for both wired and wireless connections.
Displaying the Current DNS Addresses
When you use a dynamic IP address, in most cases, you also use dynamic DNS (domain name system) addresses, which are supplied by your Internet service provider
(ISP). (The DNS enables computers and servers connected to the Internet
to find resources using domain names rather than IP addresses.) When
you switch your Windows 7 computer to a static IP address (as shown in
the next section), Windows 7 also disables the feature that allows
Windows 7 to obtain DNS addresses automatically. In other words, when
you specify a static IP address, you must also specify static DNS
addresses.
Therefore, before
performing the procedure for converting Windows 7 to a static IP
address, you need to determine your ISP’s current DNS addresses. To find
out the current DNS addresses for a network connection, use either of
the following methods:
In the
Network Connections window, click the icon of the connection you want to
work with, click the taskbar’s View Status of This Connection command
(or double-click the network connection) to open the connection’s Status
dialog box. Click Details to open the Network Connection Details dialog
box. As shown earlier in Figure 25.18, the current DNS addresses appear as the IPv4 DNS Servers values.
Select Start, All Programs, Accessories, Command Prompt to open a command-line window. At the prompt, type ipconfig /all | more
and press Enter. Windows 7 displays information about each network
connection, including the IP addresses of your ISP’s DNS servers, as
shown in the following (partial) example output:
Note
Remember that when using MORE,
you control the output of the results by either pressing Enter (to
scroll through the results one line at a time) or pressing the spacebar
(to see the results one screen at a time).
Windows IP Configuration
Host Name . . . . . . . . . . . . : OfficePC
Primary Dns Suffix . . . . . . . :
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
Ethernet adapter Local Area Connection 2:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : D-Link DGE-530T Gigabit Ethernet Adapter
Physical Address. . . . . . . . . : 00-13-46-95-84-28
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::452f:6db7:eaf2:3112%11(Preferred)
IPv4 Address. . . . . . . . . . . : 192.168.1.84(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.0.0
Lease Obtained. . . . . . . . . . : Tuesday, August 28, 2009 10:01:41 AM
Lease Expires . . . . . . . . . . : Wednesday, August 29, 2009 10:01:40 AM
Default Gateway . . . . . . . . . : 192.168.1.1
DHCP Server . . . . . . . . . . . : 192.168.1.1
DHCPv6 IAID . . . . . . . . . . . : 301994822
DNS Servers . . . . . . . . . . . : 207.164.234.193
67.69.184.223
NetBIOS over Tcpip. . . . . . . . : Enabled
Specifying the Static IP Address
You’re now just about
ready to assign a static IP address to your Windows 7 computer. The last
bit of information you need to know is the IP address to use. This is
important because you don’t want to use an address that your router has
already assigned to another computer. The easiest way to do this is to
choose an address outside of the DHCP server’s range. For example, if
you configured the DHCP server to assign addresses from the range
192.168.0.100 to 192.168.0.150, an address such as 192.168.0.50 or
192.168.0.200 will work. (Remember, too, not to use the address assigned
to your router.)
Tip
It’s probably a good
idea to check your router’s DHCP table to see which addresses it has
assigned. See your router documentation to learn how to do this.
With an IP address in hand, follow these steps to assign it to a network connection in Windows 7:
1. | Open the Network Connections window, as described earlier.
|
2. | Select the connection you want to work with.
|
3. | In
the taskbar, click Change Settings of This Connection. (You can also
right-click the connection and then click Properties.) Windows 7
display’s the connection’s Properties dialog box.
|
4. | In the Networking tab’s list of items, select Internet Protocol Version 4 (TCP/IPv4).
|
5. | Click Properties to display the Properties dialog box for Internet Protocol Version 4.
|
6. | Click to activate the Use the Following IP Address option.
|
7. | Use the IP Address box to type the IP address you want to use.
|
8. | Use
the Subnet Mask box to type the IP addresses for the subnet mask.
(Windows 7 should fill this in for automatically; the most common value
is 255.255.255.0.)
|
9. | Use the Default Gateway box to type the IP address of your network’s router.
|
10. | Use the Preferred DNS Server and Alternate DNS Server boxes to type the IP addresses of your ISP’s DNS servers. Figure 4 shows a completed version of the dialog box.
|
11. | Click OK to return to the connection’s Properties dialog box.
|
12. | Click Close. |